Repository navigation
Move Electrum fee rate estimation into a free function - #1164
randomlogin wants to merge 1 commit into
Conversation
Electrum fee estimation is used both by cbf chain and electrum chain sources, thus we make the function a free one. `ElectrumRuntimeClient::get_fee_rate_cache_update` only needs the runtime, the Electrum client, the network, the update timeout and a logger. Turn it into the free function `get_electrum_fee_rate_cache_update` so the estimation can be run without an `ElectrumRuntimeClient`. The client no longer reads its `config` field after this, so drop the field and the argument threaded through `start`/`new`. No functional change. Co-authored-by: febyeji <yeji.han@sf.snu.ac.kr>
|
I've assigned @tnull as a reviewer! |
|
a) It is the preferred way, and is present: https://github.com/lightningdevkit/ldk-node/pull/828/changes#diff-57e92d1ef2766422873e6720acf66e43a40699b73b9b0ea98071815e8d931bc5R160. b) Yeah, makes sense, I will update the PR |
Update on that: the idea is that previously For Electrum\Esplora it is already the case, both these fee sources require respective clients, so need to be able to import the code. In other words Technically we can have a compilation flags gated executable with a predefined fee source, but it seems redundant. |
Electrum fee estimation is used both by cbf chain and electrum chain sources, thus we make the function a free one.
ElectrumRuntimeClient::get_fee_rate_cache_updateonly needs the runtime, the Electrum client, the network, the update timeout and a logger. Turn it into the free functionget_electrum_fee_rate_cache_updateso the estimation can be run without anElectrumRuntimeClient.The client no longer reads its
configfield after this, so drop the field and the argument threaded throughstart/new.No functional change.